Bitwise Left Shift (<<) Operator in Python
Python3
x = 5 # x is an unsigned integer y = x << 2 # Left shift x by 2 positions print ( "Value of x after left shift by 2 positions:" , y) |
Output
Value of x after left shift by 2 positions: 20
Bitwise Left Shift(<<) Operator in Programming
Bitwise operators play a significant role in manipulating individual bits within binary data. Among these operators, the Bitwise Left Shift (<<) operator is used for shifting the bits of a number to the left by a specified number of positions. In this blog post, we’ll explore the definition, syntax, examples, and optimization techniques associated with the bitwise left shift operator.
Table of Content
- What is Bitwise Left Shift (<<) Operator
- Bitwise Left Shift (<<) Operator Syntax
- Bitwise Left Shift (<<) Operator in C
- Bitwise Left Shift (<<) Operator in C++
- Bitwise Left Shift (<<) Operator in Java
- Bitwise Left Shift (<<) Operator in Python
- Bitwise Left Shift (<<) Operator in C#
- Bitwise Left Shift (<<) Operator in Javascript
- Bitwise Left Shift (<<) Operator Use Cases
Contact Us